function clearContent(obj){    
    var node;
    if(typeof obj == 'string')
        node = document.getElementById(obj);
    else if(typeof obj == 'object')
        node = obj;
    else
        return;
    
    while (node.hasChildNodes()) {
        node.removeChild(node.lastChild);
    }
}
function currencyFormat(value)
{    
    value = value.toFixed(0);
    var num = value.toString().replace(/\./g,'');
    if(!isNaN(num)){
        num = num.toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1.');
        num = num.split('').reverse().join('').replace(/^[\.]/,'');
    }else{
        num = value;
    }
    return num;    
}